<HTML>
<BODY>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->

<B><A HREF="RMDIR.html">RMDIR(2)</A></B>		  FreeBSD System Calls Manual		      <B><A HREF="RMDIR.html">RMDIR(2)</A></B>


</PRE>
<H2>NAME</H2><PRE>
     <B>rmdir</B> - remove a directory file


</PRE>
<H2>SYNOPSIS</H2><PRE>
     <B>#include</B> <B>&lt;unistd.h&gt;</B>

     <I>int</I>
     <B>rmdir</B>(<I>const</I> <I>char</I> <I>*path</I>)


</PRE>
<H2>DESCRIPTION</H2><PRE>
     <B>Rmdir</B>() removes a directory file whose name is given by <I>path</I>. The direc-
     tory must not have any entries other than `.' and `..'.


</PRE>
<H2>RETURN VALUES</H2><PRE>
     A 0 is returned if the remove succeeds; otherwise a -1 is returned and an
     error code is stored in the global location <I>errno</I>.


</PRE>
<H2>ERRORS</H2><PRE>
     The named file is removed unless:

     [ENOTDIR]	     A component of the path is not a directory.

     [ENAMETOOLONG]  A component of a pathname exceeded 255 characters, or an
		     entire path name exceeded 1023 characters.

     [ENOENT]	     The named directory does not exist.

     [ELOOP]	     Too many symbolic links were encountered in translating
		     the pathname.

     [ENOTEMPTY]     The named directory contains files other than `.' and
		     `..' in it.

     [EACCES]	     Search permission is denied for a component of the path
		     prefix.

     [EACCES]	     Write permission is denied on the directory containing
		     the link to be removed.

     [EPERM]	     The directory containing the directory to be removed is
		     marked sticky, and neither the containing directory nor
		     the directory to be removed are owned by the effective
		     user ID.

     [EBUSY]	     The directory to be removed is the mount point for a
		     mounted file system.

     [EIO]	     An I/O error occurred while deleting the directory entry
		     or deallocating the inode.

     [EROFS]	     The directory entry to be removed resides on a read-only
		     file system.

     [EFAULT]	     <I>Path</I> points outside the process's allocated address
		     space.


</PRE>
<H2>SEE ALSO</H2><PRE>
     <B><A HREF="mkdir.html">mkdir(2)</A></B>,	<B><A HREF="unlink.html">unlink(2)</A></B>


</PRE>
<H2>HISTORY</H2><PRE>
     The <B>rmdir</B>() function call appeared in 4.2BSD.

4.2 Berkeley Distribution	 June 4, 1993				     1
</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>
